package com.cloud.utils.common.validations;
import java.util.ArrayList;
import java.util.List;


/**
 * 借口参数校验错误
 * @author monxz
 *
 * @date 2019年10月28日
 */

public class ValidResult {

    /**
     * 是否有错误
     */
    private boolean hasErrors;

    /**
     * 错误信息
     */
    private List<String > errors = new ArrayList<>();

    public boolean isHasErrors() {
        return hasErrors;
    }

    public void setHasErrors(boolean hasErrors) {
        this.hasErrors = hasErrors;
    }

    public List<String> getErrors() {
        return errors;
    }

    public void setErrors(List<String> errors) {
        this.errors = errors;
    }

    public void addError(String  msg) {
        this.errors.add( msg);
    }

    public String getErrorMsg() {
        StringBuffer  errorMsgs=new StringBuffer();
        this.errors.forEach(o->{
            errorMsgs.append(o+";");
        });
        return errorMsgs.toString();
    }


}
